<template>
    <div class="container-achievementList" @click="jumpAch">
        <div class="list-top">
            <div class="list-left">
                <img class="list-left-img" :src="listInfo.coverPicture" />
            </div>
            <div class="list-right">
                <div class="list-title">
                    <span>{{listInfo.achievementName}}</span>
                    <!-- <span class="list-price">10-20万元</span> -->
                </div>
                <div class="list-category">{{listInfo.achievementCategory}}</div>

                <div class="list-company">
                    <span>所属技术类别</span>

                    <div v-if="listInfo.belongToTechnologyCategory">
                        <template v-for="(item,idx) in listInfo.belongToTechnologyCategory">
                            <span class="my-type-list" v-if="idx<2">{{item}}</span>
                        </template>
                    </div>

                </div>

                <div class="list-content">
                    {{splitContent(listInfo.achievementDescription || '')}}

                </div>
                <div class="list-addr">
                     <span v-if="listInfo.location">
                        <i class="iconfont">&#xe634;</i>
                        <span>{{listInfo.location.province + listInfo.location.city + listInfo.location.district}}</span>
                    </span>
                    <span>
                        <i class="iconfont">&#xe62b;</i>
                        <span>{{listInfo.browseNum || 0}}</span>
                    </span>
                </div>
            </div>
        </div>
        <div class="list-bottom">
            <div class="list-bottom-left">

            </div>
            <div class="list-userbox" style="margin-right:50px">
                <img class="list-user-img" :src="listInfo.issuerHeadPortrait" />
                <div>
                    <div class="list-usertitle">发布人</div>
                    <div class="list-username">{{listInfo.issuer}}</div>
                </div>
            </div>
           <div class="list-userbox" v-if="listInfo.hasTechnicalRepresentative===1">
                <img class="list-user-img" :src="listInfo.brokerHeadPortrait" />
                <div>
                    <div class="list-usertitle">技术经纪人</div>
                    <div class="list-username">{{listInfo.technicalRepresentative}} <span class="type-warning">已认证</span></div>
                </div>
            </div>
        </div>

    </div>
</template>

<script lang="ts">
import config from "@/utils/config";
import { Vue, Component, Prop } from "vue-property-decorator";
@Component({
    name: "dom",
    components: {},
})
export default class index extends Vue {
    @Prop({ default: ()=>{} }) listInfo!: any;
    jumpAch() {
        window.open(config.clientUrl + "/#/achievementDetail?id="+this.listInfo.id);
        //this.$router.push({ name: "demandDetail" });
    }
    splitContent(str: string) {
        return str.slice(0, 65) + "...";
    }
}
</script>

<style lang="scss">
.container-achievementList:nth-child(2n) {
    margin-right: 0;
}
.container-achievementList {
    width: 100%;
    box-shadow: 0px 0px 14px 4px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    border-radius: 8px;
    display: inline-block;
    padding: 15px;

    .list-top {
        display: flex;
        border-bottom: solid 1px #eee;
    }
    .list-left {
        height: 200px;
        width: 280px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 15px;
    }
    .list-left-img {
        max-height: 100%;
        max-width: 100%;
    }
    .list-right {
        flex-shrink: 0;
        width: 1px;
        flex-grow: 1;
    }
    .list-title {
        font-weight: bold;
        font-size: 18px;
        color: #333333;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .list-price {
        color: #e94637;
    }
    .list-company {
        font-size: 16px;
        color: #333333;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 5px;
    }
    .list-category {
        font-size: 16px;
        color: #333333;
        margin-top: 5px;
    }
    .list-content {
        margin-top: 5px;
        font-size: 14px;
        color: #505050;
    }
    .list-addr {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 10px;
        .iconfont {
            margin-right: 5px;
        }
        font-size: 14px;
    }
    .list-bottom {
        display: flex;
        align-items: center;
        padding-top: 10px;
    }
    .list-bottom-left {
        flex-grow: 1;
        flex-shrink: 0;
    }
    .list-userbox {
        display: flex;
        align-items: center;
    }
    .list-user-img {
        width: 35px;
        height: 35px;
        border-radius: 35px;
        margin-right: 8px;
    }
    .list-usertitle {
        font-size: 12px;
    }
    .list-username {
        font-size: 14px;
        .type-warning {
            margin-right: 0;
            font-size: 12px;
            padding: 1px 5px;
        }
    }
}
</style>
